package com.tsmti.system.service.impl;


import com.tsmti.core.common.service.impl.BaseServiceImpl;
import com.tsmti.system.entity.Role;
import com.tsmti.system.service.RoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Title：PimsSystem
 * Class：com.ts.sys.service.impl
 * Comapny:
 *
 * @author：zcw
 * @version：2.5 CreateTime：2018/1/17 17:04
 * Modify log:
 * Description：
 */
@Transactional(rollbackFor = Exception.class)
@Service("roleService")
public class RoleServiceImpl extends BaseServiceImpl<Role> implements RoleService {

    @Override
    public List<Role> findListByUserId(long userid) {
        return findByHql(" from Role where  id in (SELECT ur.roleId from UserRole ur WHERE ur.userId=?)", userid);
    }
}